<template>
  <div id="app">
    <header class="header">
      <Nav></Nav>
    </header>
    <main>
      <router-view></router-view>
    </main>
    <footer>
      <Footer></Footer>
    </footer>
  </div>
</template>

<script>
import Nav from "@/components/nav.vue";
import Footer from "@/components/footer.vue";
import { mapMutations } from "vuex";
export default {
  components: {
    Nav,
    Footer,
  },
  data() {
    return {};
  },
  mounted() {
    this.getUserInfo();
    this.getCategoryList();
  },

  methods: {
    ...mapMutations(["updateUserInfo", "updateCategoryList"]),
    async getUserInfo() {
      const result = await this.$axios({
        url: "/userApp/user/100002",
        methods: "GET",
      });
      this.updateUserInfo(result);
    },

    async getCategoryList() {
      const result = await this.$axios({
        url: "/categoryApp/category",
        methods: "GET",
      });
      this.updateCategoryList(result);
    },
  },
};
</script>

<style >
@import "./assets/css/common.css";
</style>
